-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add attribute noting details of scrubbed values #278
Conversation
Deploying logfire-docs with Cloudflare Pages
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code here looks good.
What do we need to change in the backend?
The PR body seems kind of confusing, and/or related to something slightly different. Am I being dumb or should or be updated.
It's related. The first bit of code is a sample of attributes that this PR adds to a span: attributes = {
'logfire.scrubbed': [
{'path': ['attributes', 'usage'], 'matched_substring': 'token'},
{'path': ['attributes', 'prompt'], 'matched_substring': 'secret'},
],
} The rest of that code block is an example of how the attributes can be used to generate sample Python code which is displayed to the user for them to copy and paste to whitelist values from being scrubbed. That's the ultimate goal here. That code generation logic could also be baked into the SDK, but I think it makes more sense to do that part in the frontend. The last code block is the output of the first, i.e. the sample code which would be generated and shown to the user. The backend doesn't really need anything. But since the new attribute is stored as a string and it's not mentioned in the JSON schema, I think the backend should explicitly check for this attribute and parse the JSON just in case someone wants to query it or something. |
a8e7d5c
to
e545df4
Compare
For #248
The idea is to use this to generate code for the user to whitelist values from scrubbing. Here's some example code which I imagine being ported to the frontend:
This generates: